import 'package:finance_app/src/entities/products_services_entity.dart';

class ProductServicesListEntity {
  List<ProductsServicesEntity> dataMapped;
  String default_currency_code;
  int total_inventory;
  String total_inventory_amount;
  int total_no_inventory;
  int total_service;

  ProductServicesListEntity(
      {this.dataMapped,
      this.default_currency_code,
      this.total_inventory,
      this.total_inventory_amount,
      this.total_no_inventory,
      this.total_service});

  factory ProductServicesListEntity.fromJson(Map<String, dynamic> json) {
    return ProductServicesListEntity(
      dataMapped: json['dataMapped'] != null
          ? (json['dataMapped'] as List)
              .map((i) => ProductsServicesEntity.fromJson(i))
              .toList()
          : null,
      default_currency_code: json['default_currency_code'],
      total_inventory: json['total_inventory'],
      total_inventory_amount: json['total_inventory_amount'],
      total_no_inventory: json['total_no_inventory'],
      total_service: json['total_service'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['default_currency_code'] = this.default_currency_code;
    data['total_inventory'] = this.total_inventory;
    data['total_inventory_amount'] = this.total_inventory_amount;
    data['total_no_inventory'] = this.total_no_inventory;
    data['total_service'] = this.total_service;
    if (this.dataMapped != null) {
      data['dataMapped'] = this.dataMapped.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
